#include "comparators.h"
#include "Extern_global_Variable.h"

template <typename T>
Boolean TValueComparator<T>::IsLess(const T A, const T B)
{
	return A < B;
};

template <typename T>
Boolean TValueComparator<T>::IsGreater(const T A, const T B)
{
	return A > B;
};

template <typename T>
Boolean TValueComparator<T>::IsEqual(const T A, const T B)
{
	return A == B;
};

template <typename T, typename TComparator>
Boolean TComparable<T,TComparator>::operator<(const TComparable B)
{
	return IsLess((Pointer)this,(Pointer)&B);
};

template <typename T, typename TComparator>
Boolean TComparable<T,TComparator>::operator>(const TComparable B)
{
	return IsGreater((Pointer)this,(Pointer)&B);
};

template <typename T, typename TComparator>
Boolean TComparable<T,TComparator>::operator==(const TComparable B)
{
	return IsEqual((Pointer)this,(Pointer)&B);
};

template <typename T, typename TComparator>
T TComparable<T,TComparator>::operator=(const TComparable A)
{
	return A.Value;
};

template <typename T, typename TComparator>
TComparable<T,TComparator> TComparable<T,TComparator>::operator=(const T A)
{
	TComparable<T,TComparator> Result;
	Result.Value = A;
	return Result;
};

template <typename T>
Boolean TPointerComparator<T>::IsLess(const T A, const T B)
{
	return &A < &B;
};

template <typename T>
Boolean TPointerComparator<T>::IsGreater(const T A, const T B)
{
	return &A > &B;
};

template <typename T>
Boolean TPointerComparator<T>::IsEqual(const T A, const T B)
{
	return &A == &B;
};

template <typename T>
Boolean TMemoryComparator<T>::IsLess(const Pointer A, const Pointer B)
{
	return memcmp(A, B, sizeof(T)) < 0;
};

template <typename T>
Boolean TMemoryComparator<T>::IsGreater(const Pointer A, const Pointer B)
{
	return memcmp(A, B, sizeof(T)) > 0;
};

template <typename T>
Boolean TMemoryComparator<T>::IsEqual(const Pointer A, const Pointer B)
{
	return memcmp(A, B, sizeof(T)) == 0;
};